import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;

public class Nhanvienitf implements Commond {
	public String ten;
	public double luongcb;
	public float bacluong;
	String fileName;


	public void Nhapnv() {
		Scanner sc = new Scanner(System.in);
		System.out.println("Nhap ten: " + this.ten);
		this.ten = sc.nextLine();
		System.out.println("Nhap Luong cb: " + this.luongcb);
		this.luongcb = sc.nextDouble();
		System.out.println("Nhap Bac luong: " + this.bacluong);
		this.bacluong = sc.nextFloat();

	}

	private long TinhLuong() {
		return (long) (this.luongcb * this.bacluong);
		// TODO Auto-generated method stub

	}

	public void Xuatnv() {
		System.out.println("Ten: " + ten);
		System.out.println("Luong CB: " + luongcb);
		System.out.println("Bac Luong:  " + bacluong);
		System.out.println("Tong Luong:  " + TinhLuong());

	}

	public void Ghifilenv() {
		try {
			fileName = this.ten.toUpperCase() + ".txt".replace(" ", "_");
			FileOutputStream fos = new FileOutputStream(fileName);
			PrintWriter pr = new PrintWriter(fos);
			pr.write("Ten: " + ten + "\n");
			pr.write("\nbac Luong: \n" + bacluong + "\n");
			pr.write("\nLuong cb: \n" + luongcb + "\n");
			pr.write("\nTong Luong: : \n" + TinhLuong() + "\n");
			pr.close();
			System.out.println("ghi File ( " + fileName + " ) thanh cong");

		} catch (FileNotFoundException e) {
			System.out.println("nhap sai nhap lai");
			e.printStackTrace();
		}

	}

	public void Docfilenv() {
		fileName = this.ten.toUpperCase() + ".txt".replace(" ", "_");
try {
			
			BufferedReader input = new BufferedReader( new FileReader(fileName) );
			
			String text = "";								
			int n = 0;
			
			char[]arr = new char[512];
			n = input.read(arr);		
						
			text = new String(arr);
			
			//
			input.close();
			
			System.out.println(text);
			
		} catch (Exception e) {
			e.printStackTrace();
		}
		
	}
}